/**
 * 扩展实现bind方法,支持IE7、IE8
 */
var DocumentPolyfill = function() {
	if(document.getElementsByClassName == undefined) {
		document.getElementsByClassName = function(cls) {
			var els = document.getElementsByTagName('*');
			var ell = els.length;
			var elements = [];
			for(var n = 0; n < ell; n++) {
				var oCls = els[n].className || '';
				if(oCls.indexOf(cls) < 0) continue;
				oCls = oCls.split(/\s+/);
				var oCll = oCls.length;
				for(var j = 0; j < oCll; j++) {
					if(cls == oCls[j]) {
						elements.push(els[n]);
						break;
					}
				}
			}
			return elements;
		}
	}
}
module.exports = DocumentPolyfill;